package com.hrms.core;

import java.util.Arrays;
import java.util.List;

import com.google.appengine.api.utils.SystemProperty;



public interface Constants {
	
	public static final String ROOT = "/home/";
	public static final String EMPTY_STRING=" ";
	public static final String SYSTEM_GENERATED = "System Generated";
	public static final String UNKNOWN_REQUEST = "Unknown Request";
	public static final String INIT_BY_ID = "id";
	public static final String IN_ROLE = "inRole";
	public static final String ROLE_CHANGE = "roleChange";
	public static final String VIEW = "view";
	public static final String TASK_COUNT = "taskCount";
	public static final String ACTIVE_INDEX = "ACTIVE_INDEX";
	// High -replication applications has a weird prefix of "s~"
	public static final String APP_ID = SystemProperty.applicationId.get().replace("s~", ""); 
	
	public static final String AJAX_CALL = "ajaxCall";
	public static final String SELECTED_EMPLOYEE = "selectEmp";	
	
	public static final String FROM_DATE = "fromDate";
	public static final String TO_DATE = "toDate";
	
	public static final Integer TEAM_INTIALS_LIMIT = 4;
	
	public static enum Status {
		Blocking(""), Planned(""), InProgress(""), Completed("");
		
		String imgSrc;
		Status(String imgSrc){
			this.imgSrc = imgSrc;
		}
		public String getImgSrc() {
			return imgSrc;
		}
		
	}
	
	//transaction status
	public static enum Transaction {
		Success(0), Failed(1);
		
		String[] msg = {"Transaction completed Successfully..", "Transaction Failed!!"} ;
		int code;
		
		Transaction(int code){
			this.code = code;
		}

		public String getMsg() {
			return msg[code];
		}

		public int getCode() {
			return code;
		}
		
	}
	
	public static final String LOG_OUT_URL = "logOut";
	
	public static final String ACTION = "uaction";
	public static enum Action {
		NEW, EDIT, DEL, VIEW, TASKCHANGE, BATCH_EDIT
	}
	
	public static enum TEAM {
		ADMIN("ADMIN", "ADM"),
		SDT("SL Development", "SLD"), 
		SDTC("SL Development Customization", "SLC"), 
		SDTN("SL Development NetSuite", "SLN"), 
		SBT("SL BA", "SLB"), 
		SQT("SL QA", "SLQ"), 
		SFT("SL Finance", "SLF"), 
		SCMT("SL Client Management", "SCM"), 
		HR("HR", "SHR"),
		N("N", "NA");

		String name;
		String initials;
		
		TEAM(String name, String initials) {
			this.name = name;
			this.initials = initials;
		}

		public String getInitials() {
			return initials;
		}

		@Override
		public String toString() {
			return name;
		}
		
		public static TEAM find(String name) {
		    for (TEAM tm : TEAM.values()) {
		        if (tm.toString().equals(name)) {
		            return tm;
		        }
		    }
		    return null;
		}
				
	}
	
	public static final String ROUTE="route";
	public static final Route TEAM_DASHBOARD = new Route("Team Dashboard","index");
	public static final Route MANAGE_EMPLOYEE= new Route("Employee Record","employee");
	public static final Route POST = new Route("Discussion","discussions");
	public static final Route TASK = new Route("Progress","tasks");
	public static final Route BLOCKING_ITEMS = new Route("Blocking","blockingTasks");
	public static final Route PLANNED_ITEMS = new Route("Planned","plannedTasks");
	
	public static final List<Route> TEAM_ROUTES = Arrays.asList(TASK, BLOCKING_ITEMS, PLANNED_ITEMS, POST);
	
	public static final String NA = "n/a";

	public static enum TASK_TYPE{
		BUG, ENH, DOC, OTHR
	}
	
	/*public static enum WorkType {
		Work, Block, Plan, Discussion ,All
	}*/
	
	public static enum QueueType {
		Service("service-queue", "/Service.do"),
		Mail("mail-queue", "/tasks/SendMail.do");

		String type;
		String mapping;

		QueueType(String type, String mapping) {
			this.type = type;
			this.mapping = mapping;
		}
		public String getType() {
			return type;
		}
		public String getMapping() {
			return mapping;
		}
	}
}
